- asset = @field_group.klass_name.downcase
- klass = @field_group.klass
- id = "#{asset}_create_field_group"
- container_id = "#{asset}_field_groups"

- if @field_group.valid?
  $('##{id}_arrow').html(crm.COLLAPSED);
  $('##{id}').slideUp( { duration:250, complete: function() {$(this).html('')} } );
  $('##{container_id}').after('#{ j(render partial: "field_group", collection: [ @field_group ]) }');
  $('##{dom_id(@field_group)}').effect('highlight', { duration:1500 });

- else
  $('##{id}').html('#{ j render(partial: "new") }');
  $('##{id}').effect("shake", { duration:250, distance: 6 });
